/**
 * Created by 春旺 on 2017/3/23.
 */
//**********************************************************************************************************************
//  Hi_Lo.java          Java Foundations
import java.util.*;
public class Hi_Lo
{
    public static void main(String[] args)
    {
        String another = "y";
        int  guess, answer;

        while (another.equalsIgnoreCase("y"))
        {
            Random generator = new Random();
            answer = generator.nextInt(101);
            System.out.println(answer);

            System.out.println("Enter a number(0 to 100): ");

            Scanner scan = new Scanner(System.in);
            guess = scan.nextInt();

            System.out.println("你输入的数字是" + guess);

            if (guess != answer)

                System.out.println("答案错误");
                else
                    System.out.println("恭喜你猜对了");

                System.out.println("是否继续（y/n)");

                Scanner sca = new Scanner(System.in);
                another = sca.nextLine();
            }
        }
    }

